package com.ddtech.business.practice.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ddtech.business.practice.dto.RankDto;
import com.ddtech.business.practice.entity.PracticeUserRecord;
import com.ddtech.business.practice.query.PracticeUserRecordQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 学员练习记录表 Mapper 接口
 * </p>
 *
 * @author bin_pu
 * @since 2023-05-26
 */
@Mapper
public interface PracticeUserRecordMapper extends BaseMapper<PracticeUserRecord> {

    Map<String, Object> getStatistics(String userId);

    IPage<String> getManyError(IPage populatePage,@Param("questionName") String questionName);

    Map<String, Object> getStatisticsApp(String userId,String date);

   List<Map<String, Object>> getSevenPracticeList(String userId);

    List<Map<String, Object>> getHalfMonthPracticeList(String userId);

    IPage<RankDto> pageBankList(IPage page, @Param("practiceUserRecordQuery") PracticeUserRecordQuery practiceUserRecordQuery);

    /***
     * description: 查询专项检测平均成绩,按题库分类
     * @param:  * @param page
     * @param practiceUserRecordQuery
     * @date: 2023-05-02
     * @return: com.baomidou.mybatisplus.core.metadata.IPage<java.util.Map<java.lang.String,java.lang.Object>>
     * @version v1.0
     * @author:wei_zhang(xiao)
     */
    IPage<Map<String, Object>> typeCHeckList(IPage page,  @Param("practiceUserRecordQuery") PracticeUserRecordQuery practiceUserRecordQuery);

    /***
     * description: 查询综合检测平均成绩
     * @param:  * @param page
     * @param practiceUserRecordQuery
     * @date: 2023-05-02
     * @return: com.baomidou.mybatisplus.core.metadata.IPage<java.util.Map<java.lang.String,java.lang.Object>>
     * @version v1.0
     * @author:wei_zhang(xiao)
     */
    IPage<Map<String, Object>> allCHeckList(IPage page,  @Param("practiceUserRecordQuery") PracticeUserRecordQuery practiceUserRecordQuery);

    /***
     * description: 查询所有用户成绩
     * @param:  * @param page
     * @param practiceUserRecordQuery
     * @date: 2023-05-02
     * @return: com.baomidou.mybatisplus.core.metadata.IPage<java.util.Map<java.lang.String,java.lang.Object>>
     * @version v1.0
     * @author:wei_zhang(xiao)
     */
    IPage<Map<String, Object>> allUserGrade(IPage page,  @Param("practiceUserRecordQuery") PracticeUserRecordQuery practiceUserRecordQuery);
}
